<template>
<Select v-model="selValue" >
	<Option value="">请选择</Option>
	<Option v-for="item in list" :value="item[field]" :key="item.id">{{ item.name }}</Option>
</Select>
</template>
<script>
export default {
	data:function(){
		return{		
			list:[],
			selValue:0
		};
	},
	props:{
		value:{
			default:''
		},
		field:{
			default:'id'
		}
	},
	created:function(){
		this.selValue = this.value;
		this.load_data();
	},
	watch:{
		value(val){
			this.selValue = val;
		},
		selValue(val){
			this.$emit('input',val);
		}
	},
	methods:{
		load_data(){
			var self = this;
			var postdata = {};
			
			Whttp.load('User/Region/get_all',postdata,function(result){
				self.list = result;
			});
		}
	}
}
</script>
<style scoped>

</style>